/**
 * Copyright(c) 2014 Xunton Solutions
 *
 * History:
 *   15-1-18 下午9:00 Created by dwzhang
 */
package com.jade.modules.cms;

import java.util.Date;
import javax.persistence.*;

import com.jade.journal.JournalEntity;

/**
 * 内容操作历史记录。
 *
 * @author <a href="mailto:dwzhang@xunton.com">dwzhang</a> 
 * @version 1.0 15-1-18 下午9:00
 */
//@Entity
//@Table (name = "MODULE_CMS_RECORD_OP")
public class ContentOpRecord
        extends JournalEntity
{
    //创建
    public static final String OP_CREATE = "create";
    //更新
    public static final String OP_UPDATE = "update";
    public static final String OP_UPDATE_FOCUS = "update_focus";
    public static final String OP_UPDATE_SORT_CODE = "update_sort_code";

    //提交审核
    public static final String OP_SUBMIT = "submit";
    //审核通过
    public static final String OP_AUDIT = "audit";
    //审核拒绝
    public static final String OP_REFUSE = "refuse";
    //发布
    public static final String OP_PUBLISH = "publish";
    //撤销发布
    public static final String OP_WITHDRAW = "withdraw";
    //重新打开
    public static final String OP_REOPEN = "reopen";
    //重新提交
    public static final String OP_RESUBMIT = "resubmit";
    //删除
    public static final String OP_REMOVE = "remove";

    public static final String NAME = "journal_content_op";

    @Id
    @GeneratedValue (generator = "MODULE_SEQ_CONTENT_RECORD")
    @SequenceGenerator (name = "MODULE_SEQ_CONTENT_RECORD", sequenceName = "MODULE_SEQ_CONTENT_RECORD")
    private long id;

    //内容标识
    @Column (name = "content_id", nullable = false, updatable = false)
    private long contentId;

    //操作人类型
    @Column (name = "operator_type", nullable = false, length = 32, updatable = false)
    private String operatorType;

    @Column (name = "operator", nullable = false, length = 64, updatable = false)
    private String operator;

    //操作
    @Column (name = "operation", nullable = false, length = 32, updatable = false)
    private String operation;

    //操作描述
    @Column (name = "remark", length = 255)
    private String remark;

    //执行结果
    @Column (name = "execute_result")
    private boolean result = true;

    //错误代码
    @Column (name = "execute_code", length = 64)
    private String errorCode;

    //错误描述
    @Column (name = "execute_remark", length = 255)
    private String errorMessage;

    //执行时间
    @Column (name = "execute_date", length = 255)
    private Date executeDate;

    public ContentOpRecord()
    {
        super(NAME);
    }

    public long getId()
    {
        return id;
    }

    public void setId(long id)
    {
        this.id = id;
    }

    public long getContentId()
    {
        return contentId;
    }

    public void setContentId(long contentId)
    {
        this.contentId = contentId;
    }

    public String getOperatorType()
    {
        return operatorType;
    }

    public void setOperatorType(String operatorType)
    {
        this.operatorType = operatorType;
    }

    public String getOperator()
    {
        return operator;
    }

    public void setOperator(String operator)
    {
        this.operator = operator;
    }

    public String getOperation()
    {
        return operation;
    }

    public void setOperation(String operation)
    {
        this.operation = operation;
    }

    public String getRemark()
    {
        return remark;
    }

    public void setRemark(String remark)
    {
        this.remark = remark;
    }

    public boolean isResult()
    {
        return result;
    }

    public void setResult(boolean result)
    {
        this.result = result;
    }

    public String getErrorCode()
    {
        return errorCode;
    }

    public void setErrorCode(String errorCode)
    {
        this.errorCode = errorCode;
    }

    public String getErrorMessage()
    {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage)
    {
        this.errorMessage = errorMessage;
    }

    public Date getExecuteDate()
    {
        return executeDate;
    }

    public void setExecuteDate(Date executeDate)
    {
        this.executeDate = executeDate;
    }
}
